//生产企业维护单
import React from 'react';
import { Card, Row, Col, Form, DatePicker, Select, Button, Checkbox, Table, Switch, message, Pagination, Input  } from 'antd';
import { $http } from 'containers/config/https';
import CommonPagination from 'components/pagination/index';
import Moment from 'moment';
import store from 'store';
import './style/index.less';

const { Option } = Select;
const FormItem = Form.Item;
const formItemLayout = {    // label 和input宽度
    labelCol: { span:8 },
    wrapperCol: { span: 16 },
};
const formItemItem  = {
    labelCol: {span: 10},
    wrapperCol: {span: 14}
};
const ManufacturerMaintenance = Form.create()(
    class extends React.Component {
        constructor() {
            super();
            this.state = {
                userInfo: {}, //表单数据详情
                ManufacturerListData: [], //生产企业列表数据
                pageSize: 20,
                page: 1,
                total:0,
                rowKey: '', //行选中id
                rowData: {}, //当前行数据
                language: JSON.parse(window.sessionStorage.userData),
                ChineseEnglishSize: [],
                columns:[],
                detailWidthTotal:''
            }
            // 库存单的数据表头
            this.columns = [

                {
                    key: 1,
                    title:  '代码',
                    dataIndex: 'tkCode',
                    align: "center",
                    width: '20%'
                },
                {
                    key: 2,
                    title: '描述',
                    dataIndex: 'tkDesc',
                    align: "center",
                    width: '40%'
                },
                {
                    key: 3,
                    title: '状态',
                    dataIndex: 'tkState',
                    align: "center",
                    width: '20%'
                }
            ]
        }

        componentDidMount() {
            // 初始化数据
            this.getManufacturerList();
            this.getDetailTableColumns();
        }

        componentWillUnmount() {
            // 组件销毁前将静止让setState修改state的状态，防止内存泄漏
            this.setState = (state,callback)=>{ return; }
        }

        //清空表格内容
        resetFields = () => {
            this.props.form.resetFields();
            this.setState({userInfo: {}, rowKey: '', rowData: ''});
        };
        handleReset=()=> {
            this.resetFields();
            this.setState({ManufacturerListData: [],total: 0});
        }
        //导入数据
        importData=()=>{

        }
        searchInformation=()=>{
            this.setState({page: 1},()=>{
                this.getManufacturerList()
            })
        };
        // 获取盘点组列表数据
        getManufacturerList=()=>{
            let {language} = this.state;
            let mfCode = this.props.form.getFieldValue('mfCode');
            let mfDesc = this.props.form.getFieldValue('mfDesc');
            let mfState = this.props.form.getFieldValue('mfState');
            this.setState({loading: true})
            let data = {
                params: [
                    {
                        mfCode : mfCode ? mfCode :undefined,
                        mfDesc : mfDesc ? mfDesc :undefined,
                        mfState : mfState ? mfState :undefined,
                    }
                ],
                pagination: [
                    {
                        pageSize:this.state.pageSize,
                        currentPage:this.state.page,
                        sort:"ID",
                        dir:"asc",
                    }
                ],
            };
            $http.post('urlS', this, {
                code: "02020264",
                data: data,
                success: function (res) {
                    if(res.errorCode==0 && res.result.rows.length > 0){
                        for(let i = 0; i < res.result.rows.length; i++){
                            res.result.rows[i].key = i;
                        }
                        this.setState({ ManufacturerListData: res.result.rows, total: res.result.total, loading: false});
                    }else {
                        this.setState({ ManufacturerListData: [],total:0,loading: false});
                        if (language.language =='EN'){
                            message.error("No related data was found");
                        }else{
                            message.error("没数据");
                        }
                        this.props.form.resetFields();
                    }
                }
            });
        };

        //保存
        saveData=()=>{
            this.props.form.validateFields((error, value)=> {
                let obj = JSON.parse(JSON.stringify(value));
                if(error == null){
                    let data = {
                        params: [
                            {
                                mfID: this.state.userInfo.mfID ,	//生产商ID
                                mfSeqNo: obj.seqNo ? obj.seqNo : '',	//序号
                                mfCode: obj.code ,	//代码
                                mfDesc: obj.desc ,	//描述
                                mfENDesc:obj.ENDesc,
                                mfAddress: obj.address ? obj.address : '',	//生产企业地址
                                mfTelephone: obj.telephone ? obj.telephone : '',	//生产企业电话
                                mfFax: obj.fax ? obj.fax : '',	//生产企业传真
                                mfEmail: obj.email ? obj.email : '',	//生产企业邮箱
                                mfDrugProductNo: obj.drugProductNo ? obj.drugProductNo : '',	//药物生产许可证
                                mfDrugProductExpDate: obj.drugProductExpDate ? Moment(obj.drugProductExpDate).format('YYYY-MM-DD') : '',	//药物生产许可证有效期
                                mfComLic: obj.comLic ? obj.comLic : '',	//工商执照
                                mfComLicDate: obj.comLicDate ? Moment(obj.comLicDate).format('YYYY-MM-DD') : '',	//工商执照有效期
                                mfBusinessRegNo: obj.businessRegNo ? obj.businessRegNo : '',	//工商注册号
                                mfBusinessRegExpDate: obj.businessRegExpDate ? Moment(obj.businessRegExpDate).format('YYYY-MM-DD') : '',	//工商注册效期（营业期限）
                                mfProdEprsHygLic: obj.prodEprsHygLic ? obj.prodEprsHygLic : '',	//生产企业卫生许可证
                                mfProdEprsHygLicExpDate: obj.prodEprsHygLicExpDate ? Moment(obj.prodEprsHygLicExpDate).format('YYYY-MM-DD') : '',	//生产企业卫生许可证效期
                                mfGMP: obj.GMP ? obj.GMP : '',	//GMP认证号
                                mfSocialCreditCode: obj.socialCreditCode ? obj.socialCreditCode : '',	// 社会信用码 三证合一证号（营业执照、税务登记证、组织机构代码）
                                mfSocialCreditExpDate: obj.socialCreditExpDate ? Moment(obj.socialCreditExpDate).format('YYYY-MM-DD') : '',	//三证合一效期
                                mfManfType: obj.manfType ? obj.manfType : '',	//类型
                                mfStartDate: Moment(obj.startDate).format('YYYY-MM-DD'),	//生效日期
                                mfEndDate: obj.endDate ? Moment(obj.endDate).format('YYYY-MM-DD')  : '',	//失效日期
                            }
                        ]
                    };
                    $http.post('urlS', this, {
                        code: "02020266",
                        data: data,
                        success: function (res) {
                            if(res.errorCode == 0) {
                                message.success(res.errorMessage);
                                this.getManufacturerList();

                            }
                        }
                    });
                }
            })
        }
        // 设置行属性
        onClickRow = (record) => {
            return {
                // 单击行选中
                onClick: (e) => {
                    e.stopPropagation();
                    this.resetFields();
                    if (this.state.rowKey === '') {
                        // 保存行数据以及ID
                        this.setState({rowKey: record.ID});
                        this.ManfacturerData(record.ID)
                    } else {
                        if (this.state.rowKey !== record.ID) {
                            this.setState({rowKey: record.ID});
                            this.ManfacturerData(record.ID)
                        } else {
                            this.setState({rowKey: '', userInfo: {}});
                            this.resetFields();
                        }
                    }
                }
            }
        };

        // 表格行的类名
        setRowClassName = (record) => {
            return record.ID === this.state.rowKey ? 'clickRowStyle' : '';
        };

        ManfacturerData=(id)=>{

            let data = {
                params: [
                    {
                        mfID: id
                    }
                ]
            };
            $http.post('urlS', this, {
                code: "02020265",
                data: data,
                success: function (res) {
                    if (+res.errorCode === 0) {
                        this.setState({userInfo: res.result})
                    }
                }
            })

        };
        // 页码改变的回调，参数是改变后的页码及每页条数
        onChange = (page, pageSize) => {
            this.setState({page: page, pageSize: this.state.pageSize}, () => {
                // 重新调用查询方法
                this.getManufacturerList();
            });
        };

        onShowSizeChange = (current, size) => {
            this.setState({page: current, pageSize: size}, () => {
                // 重新调用查询方法
                this.onChange(current,size);
            })
        };

        // 显示分页总条数
        showTotal(total) {
            return `共 ${total} 条`;
        }
        //页面中英文翻译
        getDetailTableColumns = () => {
            let {language} = this.state;
            let data = {
                params: [{
                    reactCode: ['ManufacturerMaintenance'],
                    compontName: 'ManufacturerMaintenance',
                    type: 'C',
                }]
            }
            $http.post('urlS', this, {
                code: '01040073',
                data: data,
                success: function (res) {
                    if (+res.errorCode === 0) {
                        let arr = res.result.C&&res.result.C.length > 0 ? JSON.parse(JSON.stringify(res.result.C)).map((item, index) => {
                            return  {
                                ...item,
                                key: index + 1,
                                title: <div>{language.language== 'EN' ? item.enDescripts : item.title}</div>
                            }
                        }) : '';
                        let filterArr = arr.filter(function(item){ return item.display === 'Y'});
                        this.setState({columns: filterArr, detailWidthTotal: res.totalWidth,ChineseEnglishSize:language.language=='EN' ? res.result.language.EN : res.result.language.CN})
                    }
                }
            })
        };
        //获取最大代码
        saveMaxInventory=()=>{
            let data = {
                params: [{}]
            };
            $http.post('urlS', this, {
                code: "02020335",
                data: data,
                success: function (res) {
                    if(res.errorCode==0){
                        this.props.form.setFieldsValue({ code: res.result.maxCode });
                        message.success(res.errorMessage)
                    }else {
                        message.error(res.errorMessage);
                    }
                }
            });
        }
        render() {
            const { getFieldDecorator } = this.props.form;
            const {userInfo,ChineseEnglishSize,columns } = this.state;
            return (
                <div className="ManufacturerMaintenance">
                    <Col span={12}>
                        <Row>
                            <Card
                                size="small"
                                title={<div className="card-title-left-icon"><div></div>{ChineseEnglishSize.ManufacturerMaintenancelist ? ChineseEnglishSize.ManufacturerMaintenancelist.descripts:'生产企业列表'}</div>}
                            >
                                <Col span={24}>
                                    <Row >
                                        <Col span={6}>
                                            <FormItem {...formItemLayout} label={ChineseEnglishSize.ManufacturerMaintenanceimCode ? ChineseEnglishSize.ManufacturerMaintenanceimCode.descripts:'代码'}>
                                                {getFieldDecorator('mfCode',{
                                                    initialValue: undefined,
                                                })(
                                                    <Input />
                                                ) }
                                            </FormItem>
                                        </Col>
                                        <Col span={6}>
                                            <FormItem {...formItemLayout} label={ChineseEnglishSize.ManufacturerMaintenanceimDesc ? ChineseEnglishSize.ManufacturerMaintenanceimDesc.descripts:'描述'}>
                                                {getFieldDecorator('mfDesc',{
                                                    initialValue: undefined,
                                                })(
                                                    <Input />
                                                ) }
                                            </FormItem>
                                        </Col>
                                        <Col span={6}>
                                            <FormItem {...formItemLayout} label={ChineseEnglishSize.ManufacturerMaintenancestate ? ChineseEnglishSize.ManufacturerMaintenancestate.descripts:'状态'}>
                                                {getFieldDecorator('mfState',{
                                                    initialValue: undefined,
                                                })(
                                                    <Select allowClear style={{width: '100%'}}>
                                                        <Option value="1" key="1" >{ChineseEnglishSize.ManufacturerMaintenanceeffective ? ChineseEnglishSize.ManufacturerMaintenanceeffective.descripts:'有效'}</Option>
                                                        <Option value="0" key="0" >{ChineseEnglishSize.ManufacturerMaintenanceinvalid ? ChineseEnglishSize.ManufacturerMaintenanceinvalid.descripts:'失效'}</Option>
                                                    </Select>
                                                ) }
                                            </FormItem>
                                        </Col>
                                        <Col style={{textAlign: 'center'}} span={6}>
                                            <Button onClick={this.searchInformation}>{ChineseEnglishSize.ManufacturerMaintenancesearch ? ChineseEnglishSize.ManufacturerMaintenancesearch.descripts:'查询'}</Button>
                                            <Button type="primary" onClick={this.handleReset} style={{marginLeft: '20px'}}>{ChineseEnglishSize.ManufacturerMaintenanceclean ? ChineseEnglishSize.ManufacturerMaintenanceclean.descripts:'清屏'}</Button>
                                        </Col>
                                    </Row>
                                </Col>
                            </Card>
                        </Row>
                        <Row>
                            <Col>
                                <Card
                                    size="small"
                                >
                                    <div  style={{height: store.getState().tableHeight.y +94 + 'px'}}>
                                        <Table
                                            columns={columns.length>0?columns:this.columns}
                                            dataSource={this.state.ManufacturerListData}
                                            pagination={false}
                                            bordered
                                            style={{height: store.getState().tableHeight.y +61 + 'px'}}
                                            scroll={{ y: store.getState().tableHeight.y +10 }}
                                            rowKey={record => record.key}
                                            onRow={this.onClickRow}
                                            rowClassName={this.setRowClassName}
                                        />
                                        <CommonPagination size='small' current={this.state.page} total={this.state.total} search= 'search'
                                                          onShowSizeChange={this.onShowSizeChange.bind(this)} complete={true} dataSource={this.state.ManufacturerListData}
                                                          loading={this.state.loading} onChange={this.onChange.bind(this)} pageSize={true} />
                                    </div>
                                </Card>
                            </Col>
                        </Row>
                    </Col>
                    <Col span={12}>
                        <Col >

                            <Form>
                                <Card
                                    title={<div className="card-title-left-icon"><div></div>{ChineseEnglishSize.ManufacturerMaintenanceinfo ? ChineseEnglishSize.ManufacturerMaintenanceinfo.descripts:'生产企业信息'}</div>}
                                    size="small"
                                >
                                    <div  style={{height: store.getState().tableHeight.y +129 + 'px'}}>
                                        <Col >
                                            <Row>
                                                <Col span={11}>
                                                    <FormItem label={ChineseEnglishSize.ManufacturerMaintenanceseqNo ? ChineseEnglishSize.ManufacturerMaintenanceseqNo.descripts:'生产企业序号：'} {...formItemItem}>
                                                        {getFieldDecorator('seqNo', {
                                                            initialValue: userInfo.mfSeqNo ? userInfo.mfSeqNo : undefined,
                                                        })(
                                                            <Input style={{width: '100%'}} type="number" />
                                                        )}
                                                    </FormItem>
                                                </Col>
                                                <Col span={11} className='maxInventory'>
                                                    <FormItem label={ChineseEnglishSize.ManufacturerMaintenancecode ? ChineseEnglishSize.ManufacturerMaintenancecode.descripts:'生产企业代码：'} {...formItemItem}>
                                                        {getFieldDecorator('code', {
                                                            initialValue: userInfo.mfCode ? userInfo.mfCode : undefined,
                                                            rules:[{ required : ChineseEnglishSize.ManufacturerMaintenancecode ? ChineseEnglishSize.ManufacturerMaintenancecode.required =='Y'? true:false: false, message: ChineseEnglishSize.ManufacturerMaintenancecode ? ChineseEnglishSize.ManufacturerMaintenancecode.message:'请输入生产企业代码'}]
                                                        })(
                                                            <Input style={{width: '100%'}} />
                                                        )}
                                                    </FormItem>
                                                    <a className='max' onClick={this.saveMaxInventory}>{ChineseEnglishSize.MaterialInventoryItemMaintenanmaxCode ? ChineseEnglishSize.MaterialInventoryItemMaintenanmaxCode.descripts:'最大码'}</a>
                                                </Col>
                                            </Row>
                                            <Row>
                                                <Col span={11}>
                                                    <FormItem label={ChineseEnglishSize.ManufacturerMaintenancedesc ? ChineseEnglishSize.ManufacturerMaintenancedesc.descripts:'生产企业描述：'} {...formItemItem}>
                                                        {getFieldDecorator('desc', {
                                                            initialValue: userInfo.mfDesc ? userInfo.mfDesc : undefined,
                                                            rules:[{ required : ChineseEnglishSize.ManufacturerMaintenancedesc ? ChineseEnglishSize.ManufacturerMaintenancedesc.required =='Y'? true:false: false, message: ChineseEnglishSize.ManufacturerMaintenancedesc ? ChineseEnglishSize.ManufacturerMaintenancedesc.message:'请输入生产企业描述'}]
                                                        })(
                                                            <Input style={{width: '100%'}} />
                                                        )}
                                                    </FormItem>
                                                </Col>
                                                <Col span={11}>
                                                    <FormItem label={ChineseEnglishSize.ManufacturerMaintenanceaddress ? ChineseEnglishSize.ManufacturerMaintenanceaddress.descripts:'生产企业地址：'} {...formItemItem}>
                                                        {getFieldDecorator('address', {
                                                            initialValue: userInfo.mfAddress ? userInfo.mfAddress : undefined,
                                                        })(
                                                            <Input style={{width: '100%'}} />
                                                        )}
                                                    </FormItem>
                                                </Col>
                                            </Row>
                                            <Row>
                                                <Col span={11}>
                                                    <FormItem label={ChineseEnglishSize.ManufacturerMaintenancetelephone ? ChineseEnglishSize.ManufacturerMaintenancetelephone.descripts:'生产企业电话：'} {...formItemItem}>
                                                        {getFieldDecorator('telephone', {
                                                            initialValue: userInfo.mfTelephone ? userInfo.mfTelephone : undefined,
                                                        })(
                                                            <Input style={{width: '100%'}} />
                                                        )}
                                                    </FormItem>
                                                </Col>
                                                <Col span={11}>
                                                    <FormItem label={ChineseEnglishSize.ManufacturerMaintenancefax ? ChineseEnglishSize.ManufacturerMaintenancefax.descripts:'生产企业传真：'} {...formItemItem}>
                                                        {getFieldDecorator('fax', {
                                                            initialValue: userInfo.mfFax ? userInfo.mfFax : undefined,
                                                        })(
                                                            <Input style={{width: '100%'}} />
                                                        )}
                                                    </FormItem>
                                                </Col>
                                            </Row>
                                            <Row>
                                                <Col span={11}>
                                                    <FormItem label={ChineseEnglishSize.ManufacturerMaintenanceemail ? ChineseEnglishSize.ManufacturerMaintenanceemail.descripts:'生产企业邮箱：'} {...formItemItem}>
                                                        {getFieldDecorator('email', {
                                                            initialValue: userInfo.mfEmail ? userInfo.mfEmail : undefined,
                                                        })(
                                                            <Input style={{width: '100%'}} />
                                                        )}
                                                    </FormItem>
                                                </Col>
                                                <Col span={11}>
                                                    <FormItem label={ChineseEnglishSize.ManufacturerMaintenanceGMP ? ChineseEnglishSize.ManufacturerMaintenanceGMP.descripts:'GMP认证号：'} {...formItemItem}>
                                                        {getFieldDecorator('GMP', {
                                                            initialValue: userInfo.mfGMP ? userInfo.mfGMP : undefined,
                                                        })(
                                                            <Input style={{width: '100%'}} />
                                                        )}
                                                    </FormItem>
                                                </Col>
                                            </Row>
                                            <Row>
                                                <Col span={11}>
                                                    <FormItem label={ChineseEnglishSize.ManufacturerMaintenancedrugProductNo ? ChineseEnglishSize.ManufacturerMaintenancedrugProductNo.descripts:'药物生产许可证：'} {...formItemItem}>
                                                        {getFieldDecorator('drugProductNo', {
                                                            initialValue: userInfo.mfDrugProductNo ? userInfo.mfDrugProductNo : undefined,
                                                        })(
                                                            <Input style={{width: '100%'}} />
                                                        )}
                                                    </FormItem>
                                                </Col>
                                                <Col span={11}>
                                                    <FormItem label={ChineseEnglishSize.ManufacturerMaintenancedrugProductExpDate ? ChineseEnglishSize.ManufacturerMaintenancedrugProductExpDate.descripts:'许可证有效期：'} {...formItemItem}>
                                                        {getFieldDecorator('drugProductExpDate', {
                                                            initialValue:  userInfo.mfDrugProductExpDate ? Moment(userInfo.mfDrugProductExpDate) : undefined,
                                                        })(
                                                            <DatePicker
                                                                format="YYYY-MM-DD"
                                                                style={{width:'100%'}}
                                                            >
                                                            </DatePicker>
                                                        )}
                                                    </FormItem>
                                                </Col>
                                            </Row>
                                            <Row>
                                                <Col span={11}>
                                                    <FormItem label={ChineseEnglishSize.ManufacturerMaintenancecomLic ? ChineseEnglishSize.ManufacturerMaintenancecomLic.descripts:'工商执照：'} {...formItemItem}>
                                                        {getFieldDecorator('comLic', {
                                                            initialValue: userInfo.mfComLic ? userInfo.mfComLic : undefined,
                                                        })(
                                                            <Input style={{width: '100%'}} />
                                                        )}
                                                    </FormItem>
                                                </Col>
                                                <Col span={11}>
                                                    <FormItem label={ChineseEnglishSize.ManufacturerMaintenancecomLicDate ? ChineseEnglishSize.ManufacturerMaintenancecomLicDate.descripts:'工商执照有效期：'} {...formItemItem}>
                                                        {getFieldDecorator('comLicDate', {
                                                            initialValue:  userInfo.mfComLicDate ? Moment(userInfo.mfComLicDate) : undefined,
                                                        })(
                                                            <DatePicker
                                                                format="YYYY-MM-DD"
                                                                style={{width:'100%'}}
                                                            >
                                                            </DatePicker>
                                                        )}
                                                    </FormItem>
                                                </Col>
                                            </Row>
                                            <Row>
                                                <Col span={11}>
                                                    <FormItem label={ChineseEnglishSize.ManufacturerMaintenancebusinessRegNo ? ChineseEnglishSize.ManufacturerMaintenancebusinessRegNo.descripts:'工商注册号：'} {...formItemItem}>
                                                        {getFieldDecorator('businessRegNo', {
                                                            initialValue: userInfo.mfBusinessRegNo ? userInfo.mfBusinessRegNo : undefined,
                                                        })(
                                                            <Input style={{width: '100%'}} />
                                                        )}
                                                    </FormItem>
                                                </Col>
                                                <Col span={11}>
                                                    <FormItem label={ChineseEnglishSize.ManufacturerMaintenancebusinessRegExpDate ? ChineseEnglishSize.ManufacturerMaintenancebusinessRegExpDate.descripts:'工商注册效期：'} {...formItemItem}>
                                                        {getFieldDecorator('businessRegExpDate', {
                                                            initialValue:  userInfo.mfBusinessRegExpDate ? Moment(userInfo.mfBusinessRegExpDate) : undefined,
                                                        })(
                                                            <DatePicker
                                                                format="YYYY-MM-DD"
                                                                style={{width:'100%'}}
                                                            >
                                                            </DatePicker>
                                                        )}
                                                    </FormItem>
                                                </Col>
                                            </Row>
                                            <Row>
                                                <Col span={11}>
                                                    <FormItem label={ChineseEnglishSize.ManufacturerMaintenanceprodEprsHygLic ? ChineseEnglishSize.ManufacturerMaintenanceprodEprsHygLic.descripts:'企业卫生许可证：'} {...formItemItem}>
                                                        {getFieldDecorator('prodEprsHygLic', {
                                                            initialValue: userInfo.mfProdEprsHygLic ? userInfo.mfProdEprsHygLic : undefined,
                                                        })(
                                                            <Input style={{width: '100%'}} />
                                                        )}
                                                    </FormItem>
                                                </Col>
                                                <Col span={11}>
                                                    <FormItem label={ChineseEnglishSize.ManufacturerMaintenanceprodEprsHygLicExpDate ? ChineseEnglishSize.ManufacturerMaintenanceprodEprsHygLicExpDate.descripts:'卫生许可证效期：'} {...formItemItem}>
                                                        {getFieldDecorator('prodEprsHygLicExpDate', {
                                                            initialValue:  userInfo.mfProdEprsHygLicExpDate ? Moment(userInfo.mfProdEprsHygLicExpDate) : undefined,
                                                        })(
                                                            <DatePicker
                                                                format="YYYY-MM-DD"
                                                                style={{width:'100%'}}
                                                            >
                                                            </DatePicker>
                                                        )}
                                                    </FormItem>
                                                </Col>
                                            </Row>
                                            <Row>
                                                <Col span={11}>
                                                    <FormItem label={ChineseEnglishSize.ManufacturerMaintenancesocialCreditCode ? ChineseEnglishSize.ManufacturerMaintenancesocialCreditCode.descripts:'社会信用码：'} {...formItemItem}>
                                                        {getFieldDecorator('socialCreditCode', {
                                                            initialValue: userInfo.mfSocialCreditCode ? userInfo.mfSocialCreditCode : undefined,
                                                        })(
                                                            <Input style={{width: '100%'}} />
                                                        )}
                                                    </FormItem>
                                                </Col>
                                                <Col span={11}>
                                                    <FormItem label={ChineseEnglishSize.ManufacturerMaintenancesocialCreditExpDate ? ChineseEnglishSize.ManufacturerMaintenancesocialCreditExpDate.descripts:'信用码效期：'} {...formItemItem}>
                                                        {getFieldDecorator('socialCreditExpDate', {
                                                            initialValue:  userInfo.mfSocialCreditExpDate ? Moment(userInfo.mfSocialCreditExpDate) : undefined,
                                                        })(
                                                            <DatePicker
                                                                format="YYYY-MM-DD"
                                                                style={{width:'100%'}}
                                                            >
                                                            </DatePicker>
                                                        )}
                                                    </FormItem>
                                                </Col>
                                            </Row>
                                            <Row>
                                                <Col span={11}>
                                                    <FormItem label={ChineseEnglishSize.ManufacturerMaintenancemanfType ? ChineseEnglishSize.ManufacturerMaintenancemanfType.descripts:'类型：'} {...formItemItem}>
                                                        {getFieldDecorator('manfType', {
                                                            initialValue: userInfo.mfManfType ? userInfo.mfManfType : undefined,
                                                        })(
                                                            <Input style={{width: '100%'}} />
                                                        )}
                                                    </FormItem>
                                                </Col>
                                                <Col span={11}>
                                                    <FormItem label={ChineseEnglishSize.ManufacturerMaintenanceENDesc ? ChineseEnglishSize.ManufacturerMaintenanceENDesc.descripts:'英文描述：'} {...formItemItem}>
                                                        {getFieldDecorator('ENDesc', {
                                                            initialValue:  userInfo.mfENDesc ? userInfo.mfENDesc : undefined,
                                                        })(
                                                            <Input style={{width: '100%'}} />
                                                        )}
                                                    </FormItem>
                                                </Col>
                                            </Row>
                                            <Row>
                                                <Col span={11}>
                                                    <FormItem label={ChineseEnglishSize.ManufacturerMaintenancestartDate ? ChineseEnglishSize.ManufacturerMaintenancestartDate.descripts:'生效日期：'} {...formItemItem}>
                                                        {getFieldDecorator('startDate', {
                                                            initialValue:  userInfo.mfStartDate ? Moment(userInfo.mfStartDate) : undefined,
                                                            rules:[{ required : ChineseEnglishSize.ManufacturerMaintenancestartDate ? ChineseEnglishSize.ManufacturerMaintenancestartDate.required =='Y'? true:false: false, message: ChineseEnglishSize.ManufacturerMaintenancestartDate ? ChineseEnglishSize.ManufacturerMaintenancestartDate.message:'请选择生效日期'}]
                                                        })(
                                                            <DatePicker
                                                                format="YYYY-MM-DD"
                                                                style={{width:'100%'}}
                                                            >
                                                            </DatePicker>
                                                        )}
                                                    </FormItem>
                                                </Col>
                                                <Col span={11}>
                                                    <FormItem label={ChineseEnglishSize.ManufacturerMaintenanceendDate ? ChineseEnglishSize.ManufacturerMaintenanceendDate.descripts:'失效日期'} {...formItemItem}>
                                                        {getFieldDecorator('endDate', {
                                                            initialValue: userInfo.mfEndDate ? Moment(userInfo.mfEndDate) : undefined,
                                                        })(
                                                            <DatePicker
                                                                format="YYYY-MM-DD"
                                                                style={{width:'100%'}}
                                                            >
                                                            </DatePicker>
                                                        )}
                                                    </FormItem>
                                                </Col>
                                            </Row>
                                        </Col>
                                    </div>
                                </Card>
                            </Form>

                        </Col>
                        <Col>
                            <Row style={{marginTop: '10px',textAlign: 'right'}} >
                                <Button type="primary" style={{marginRight: '30px'}} onClick={this.saveData}>{ChineseEnglishSize.ManufacturerMaintenancesave ? ChineseEnglishSize.ManufacturerMaintenancesave.descripts:'保存'}</Button>
                                <Button onClick={this.resetFields}>{ChineseEnglishSize.ManufacturerMaintenancereset ? ChineseEnglishSize.ManufacturerMaintenancereset.descripts:'重置'}</Button>
                            </Row>
                        </Col>
                    </Col>
                </div>
            )
        }
    }
);
export default ManufacturerMaintenance;